QLibrary: fix deadlock caused by fix to QTBUG-39642
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Wed, 19 Aug 2020 17:40:32 +0000 (18:40 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Wed, 19 Aug 2020 17:40:32 +0000 (18:40 +0100)
commitf680e29ca97b27d04d29af2dd28d23c07315eaf9
tree4cdd6090caf3d039f0991ea8cfbe13b6192db733
parent7055a6362e9542bad2ed28060ad50242d2c0bd51
QLibrary: fix deadlock caused by fix to QTBUG-39642

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=276fa8383a753576
Last-Update: 2020-04-17

Commit ae6f73e8566fa76470937aca737141183929a5ec inserted a mutex around
the entire load_sys(). We had reasoned that deadlocks would only occur if
the object creation in instance() recursed into its own instance(),
which was already a bug. But we had forgotten that dlopen()/
LoadLibrary() executes initialization code from the module being loaded,
which could cause a recursion back into the same QPluginLoader or
QLibrary object. This recursion is benign because the module *is* loaded
and dlopen()/LoadLibrary() returns the same handle.

Gbp-Pq: Name fix_qlibrary_deadlock.diff
src/corelib/plugin/qlibrary.cpp
src/corelib/plugin/qlibrary_unix.cpp
src/corelib/plugin/qlibrary_win.cpp